home *** CD-ROM | disk | FTP | other *** search
/ Software USA 4 #1 / Software USA Volume 4.01.iso / mac / Home and Office / View Picture / README < prev    next >
Encoding:
Text File  |  1995-11-24  |  10.6 KB  |  148 lines  |  [ttro/ttxt]

  1. View Picture Documentation—1.1.0
  2. View Picture is a utility for viewing, cropping, and compressing pictures (if QuickTime is available). It is scriptable and recordable, and supports drag-and-drop (if available) and balloon help. It requires system 7.0 or higher. View Picture uses an intelligent algorithm for cropping pictures that determines how many colors are required and doesn't use a deeper bitmap than necessary.
  3.  
  4. Please report any bugs (not described in this documentation) to geoffk@ozemail.com.au.
  5.  
  6. Most of what view picture does is obvious, and there's always balloon help—but you should read the legal information at the end of this document. The only thing that might not be obvious is how to script it:
  7.  
  8. Scripting View Picture
  9.  
  10. View Picture fully supports the Core and Required Suites (with one exception relating to selections). It also supports the cut, copy, and paste events, and transactions.
  11.  
  12. The exception for selections is that selections in View Picture do not contain object specifiers. To get an object specifier for a selection, you use get the contents of selection as reference (or similar to get the selection of a particular document, get the contents of the selection of window 1 as reference—see bugs below). To set the selection, use set the selection to some picture of document 1 or similar.
  13.  
  14. View Picture also supports a few events and object classes of its own. All of these are fully described in its dictionary (which I've pasted in from Script Editor and put below), except for the way you select picture objects. To get the entire picture of a document, you can write ‘some picture of document 1’ (or send an equivalent event using some other method) but you can also get parts of pictures. AppleScript doesn't support this. From a programming language, you create an object specifier record, with:
  15. keyAEDesiredClass: 'PICT'
  16. keyAEContainer: object specifier records for the picture document or picture that contains this picture
  17. keyAEKeyForm: pBounds
  18. keyAEKeyData: a rectangle, typeRectangle, containing the coordinates than enclose the part of the picture this record is to reference.
  19.  
  20. This lets you get and copy pictures without having to change the selection (as you would have to to get equivalent functionality from AppleScript).
  21.  
  22. View Picture suite: Suite for things specific to View Picture
  23.  
  24. compress: Use QuickTime to compress the picture
  25.     compress  reference  -- the picture to compress
  26.         [compressor  JPEG/none/graphics/run length encoding]  -- the kind of compressor to use; defaults to the user’s settings or jpeg
  27.         [quality  integer]  -- the amount of compression to do (0-1024), or
  28.         [quality  lossless/maximum/high/normal/low/minimum]  -- the amount of compression to do; defaults to the user’s settings or normal
  29.         [depth  integer]  -- the compression depth: 1,2,4,8,16,24,32 for color, 34,36,40 for 2/4/8-bit greyscale, 0 for ‘what the picture asks for’; defaults to the user’s settings or 0
  30.  
  31. make bitmap: Make a picture into a bitmap
  32.     make bitmap  reference  -- the picture to make into a bitmap
  33.  
  34. Class about box: The document produced by choosing ‘About…’
  35. Elements:
  36.     window by numeric index, by ID, by name, satisfying a test
  37. Properties:
  38.     about picture  picture  [r/o]  -- the picture in the box
  39.     best type  type class  [r/o]  -- the data type that can contain the most information from objects of this class
  40.     class  type class  [r/o]  -- the class of this object
  41.     default type  type class  [r/o]  -- the default data type for this object
  42.     id  integer  [r/o]  -- the (unique) id number of this object
  43.     index  integer  -- the number of the document
  44.     modified  boolean  [r/o]  -- Has the document been modified since the last save?
  45.     name  string  [r/o]  -- the name of the document
  46.  
  47. Class picture document: A document containing a picture
  48. Elements:
  49.     window by numeric index, by ID, by name, satisfying a test
  50.     picture by numeric index, 'pbnd'
  51. Properties:
  52.     best type  type class  [r/o]  -- the data type that can contain the most information from objects of this class
  53.     class  type class  [r/o]  -- the class of this object
  54.     default type  type class  [r/o]  -- the default data type for this object
  55.     id  integer  [r/o]  -- the (unique) id number of this object
  56.     index  integer  -- the number of the document
  57.     modified  boolean  [r/o]  -- Has the document been modified since the last save?
  58.     name  string  [r/o]  -- the name of the document
  59.  
  60. Class picture: A QuickDraw picture
  61. Elements:
  62.     picture 'pbnd'
  63. Properties:
  64.     arcs  integer  [r/o]  -- the number of arcs in this picture
  65.     best type  type class  [r/o]  -- the data type that can contain the most information from objects of this class
  66.     bitmaps  integer  [r/o]  -- the number of bitmaps in this picture
  67.     bounds  bounding rectangle  [r/o]  -- the boundary rectangle for the picture
  68.     class  type class  [r/o]  -- the class of this object
  69.     comments  integer  [r/o]  -- the number of picture comments in this picture
  70.     default type  type class  [r/o]  -- the default data type for this object
  71.     depth  integer  [r/o]  -- the maximum number of bits per pixel required for this picture
  72.     horizontal resolution  fixed  [r/o]  -- the number of pixels per inch for this picture in the horizontal direction
  73.     lines  integer  [r/o]  -- the number of lines in this picture
  74.     ovals  integer  [r/o]  -- the number of ovals in this picture
  75.     pixmaps  integer  [r/o]  -- the number of pixmaps in this picture
  76.     polygons  integer  [r/o]  -- the number of polygons in this picture
  77.     rounded rectangles  integer  [r/o]  -- the number of rounded rectangles in this picture
  78.     rectangles  integer  [r/o]  -- the number of rectangles in this picture
  79.     regions  integer  [r/o]  -- the number of QuickDraw regions in this picture
  80.     texts  integer  [r/o]  -- the number of text strings in this picture
  81.     complexity  unknown/original/color/extended/compressed  [r/o]  -- an indicator of the complexity of this picture
  82.     unique colors  integer  [r/o]  -- the number of different colors in this picture
  83.     unique comments  integer  [r/o]  -- the number of different comments in this picture
  84.     unique fonts  integer  [r/o]  -- the number of different fonts in this picture
  85.     vertical resolution  fixed  [r/o]  -- the number of pixels per inch for this picture in the vertical direction
  86.  
  87.  
  88. Known bugs in View Picture:
  89. - view picture doesn't always recognise certain compressed pictures as compressed (because it uses the wrong algorithm to determine if a picture is compressed or not). As well as affecting display of the menus, this can cause problems with cropping and conversion of pictures to bitmaps; view picture can estimate the number of bits per pixel required to be much lower than it should be (for instance, 1 bit, for a partly JPEG-compressed picture).
  90. - saving documents isn't really well thought out; for one thing, the ‘do you want to save’ dialog shouldn't mention the name of a picture if it doesn't have one.
  91. - view picture always zooms a window to the main display, not the display it's currently on.
  92.  
  93. View picture has been tested under system 7.0.1, 7.1.0 and 7.1.2. There is no reason it should have problems on system 7.5.1, or on 7.5.0 (but you shouldn't be running 7.5.0, it has many bugs). It has been tested on an SE, on a Classic II, and on a Power Macintosh 6100/60, so it would be surprising if there was a configuration it doesn't run on.
  94.  
  95. Known bugs in other software:
  96. - when a window is closed in view picture, it doesn't release the colors it was using, so (amongst other things) icons in the finder go to black-and-white. Workaround: quit view picture.
  97. - the following script doesn't work properly in AppleScript:
  98.  
  99. tell application "view picture"
  100.     activate
  101.     set the selection to some picture of document 1
  102.     get the contents of selection as reference
  103. end tell
  104.  
  105. (the result it produces is not properly decoded by AppleScript; and you can't paste that result back into a script either.)
  106. You need to use:
  107.  
  108. tell application "view picture"
  109.     activate
  110.     set the selection to some picture of document 1
  111.     get the bounds of the contents of selection
  112. end tell
  113.  
  114. - The following script won't compile in AppleScript:
  115.  
  116. tell application "view picture"
  117.     activate
  118.     get every property of document 1
  119. end tell
  120.  
  121. You need to substitute “«class prop»” for “property” to make it compile, but AppleScript decompiles the resulting script to the above.
  122. - the following script doesn't do what you'd like:
  123.  
  124. tell application "view picture"
  125.     activate
  126.     get every property of document 1 as reference
  127. end tell
  128.  
  129. (and doesn't compile, see above). It comes close, though; the partial result is what you probably wanted.
  130. - SimpleText insists on showing the scripts above in color, and doesn't let you turn it off.
  131.  
  132. Revision History
  133. Revision 1.1.0: The user interface for changing the compression method has changed; we now use the standard dialog box. The Apple Event for compression has added an extra depth parameter, and the quality parameter can now also be an number, for finer control. quit saving no now works. There is now an alternative picture for new documents when there are few colors available. Commands involving the clipboard ensure that view picture is the frontmost application (as otherwise it doesn’t have a clipboard to do anything with). Finally, if Easy Open is installed, view picture saved documents are called ‘View Picture picture’ (you may need to rebuild your desktop to ensure this).
  134.  
  135. Legal Notice and Licence
  136. The author does not claim that View Picture is suitable for any purpose whatsoever. Because View Picture is provided free of charge, no warranty is provided. The author accepts no liability or responsibility of any sort for any loss or damage resulting from the use or operation of this software.
  137.  
  138. This documentation is Copyright 1995 Geoffrey Keating. All rights are reserved. You (the reader) are licensed to make and distribute unmodified copies of this documentation.
  139.  
  140. View Picture bears the following copyright notice and license:
  141.  
  142. “View Picture is Copyright 1994-1995 Geoffrey Keating. All rights are reserved.
  143.  
  144. You (the reader) are licensed to use this software and to make and distribute unmodified copies of this software, on condition that you not attempt to decompile, reverse engineer, or otherwise attempt to reduce this software to a human-readable form. By copying or using this software you are taken to agree to the terms of this license.”
  145.  
  146. Signature
  147. This documentation, the View Picture application, and the Stuffit archive they are distributed in, are all signed by me using PowerTalk. The purpose of this is to give some reassurance that the program has not been tampered with in transit. To check a signature, choose “Get Info” in the Finder, and click on the icon next to the space for comments. If you don’t see an icon, either the signatures have been removed or you’re not running PowerTalk.
  148.